#include <algorithm>
#include <format>
#include <iostream>
using namespace std;
int main() {
  int P;
  cin >> P;

  auto toBase = [base=P](int x) {
    string res;
    while (x) {
      int mod = x % base;
      res += (mod < 10 ? mod + '0' : mod - 10 + 'A');
      x /= base;
    }
    reverse(res.begin(), res.end());
    return res;
  };

  for (int i = 1; i < P; i++) {
    for (int j = 1; j <= i; j++) {
      cout << format("{}*{}={} ", toBase(i), toBase(j), toBase(i * j));
    }
    cout << endl;
  }
}